package com.example.linktop.active;

import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.util.Log;
import android.view.View;

public class SecondActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.second_layout);

        Intent intent = getIntent();
        String name = intent.getStringExtra("name");

        Log.w("SecondActivity", name);

    }




    public void backClick(View v) {

        //返回数据
        Intent intent = getIntent();
        intent.putExtra("back", "我是你爷爷");
        setResult(RESULT_OK, intent);

        //返回上个页面逻辑
        finish();

    }

    @Override
    public void onBackPressed() {

        //返回数据
        Intent intent = getIntent();
        intent.putExtra("back", "我是你爷爷");
        setResult(RESULT_OK, intent);
        finish();

    }


}
